package com.shujia.wyh.day19;

import java.util.LinkedList;

public class MyStack {
    private LinkedList linkedList;

    MyStack(){
        this.linkedList = new LinkedList();
    }

    public void myAdd(Object object){
        linkedList.addFirst(object);
    }

    public Object myGet(){
//        return linkedList.getFirst();
        return linkedList.removeFirst();
    }

    //判断集合中是否还有元素
    public boolean myIsEmpty(){
        return linkedList.isEmpty();
    }
}
